package com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


import com.yuexunit.operationman.nbsy.R;
import com.yuexunit.operationman.nbsy.config.AppConfig;
import com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.bean.BeforeAnesthesiaBean;
import com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.ui.Act_BeforeAnesthesiaPreview;

import org.kymjs.kjframe.ui.KJFragment;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by chenss on 2017/8/8 0008.
 */

public class Fragment_BA_Status extends KJFragment {
    @Bind(R.id.frag_ba_st_01)
    TextView fragBaSt01;
    @Bind(R.id.frag_ba_st_02)
    TextView fragBaSt02;
    @Bind(R.id.frag_ba_st_03)
    TextView fragBaSt03;
    @Bind(R.id.frag_ba_st_04)
    TextView fragBaSt04;
    @Bind(R.id.frag_ba_st_05)
    TextView fragBaSt05;
    @Bind(R.id.frag_ba_st_06)
    TextView fragBaSt06;
    @Bind(R.id.frag_ba_st_07)
    TextView fragBaSt07;
    @Bind(R.id.frag_ba_st_08)
    TextView fragBaSt08;
    @Bind(R.id.frag_ba_st_09)
    TextView fragBaSt09;
    @Bind(R.id.frag_ba_st_10)
    TextView fragBaSt10;
    @Bind(R.id.frag_ba_st_11)
    TextView fragBaSt11;
    @Bind(R.id.frag_ba_st_12)
    TextView fragBaSt12;
    @Bind(R.id.frag_ba_st_13)
    TextView fragBaSt13;
    @Bind(R.id.frag_ba_st_14)
    TextView fragBaSt14;
    @Bind(R.id.frag_ba_st_15)
    TextView fragBaSt15;
    @Bind(R.id.frag_ba_st_16)
    TextView fragBaSt16;
    @Bind(R.id.frag_ba_st_17)
    TextView fragBaSt17;
    @Bind(R.id.frag_ba_st_18)
    TextView fragBaSt18;
    @Bind(R.id.frag_ba_st_19)
    TextView fragBaSt19;
    @Bind(R.id.frag_ba_st_20)
    TextView fragBaSt20;
    @Bind(R.id.frag_ba_st_21)
    TextView fragBaSt21;
    @Bind(R.id.frag_ba_st_22)
    TextView fragBaSt22;
    @Bind(R.id.frag_ba_st_23)
    TextView fragBaSt23;

    private Act_BeforeAnesthesiaPreview aty;
    protected View mMainView;

    @Override
    protected View inflaterView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
        aty = (Act_BeforeAnesthesiaPreview) getActivity();
        mMainView = inflater.inflate(R.layout.fragment_ba_status, container, false);
        ButterKnife.bind(this, mMainView);
        return mMainView;
    }

    @Override
    protected void initData() {
        for (BeforeAnesthesiaBean.ObjectEntity.VisitItemsEntity p : AppConfig.BEFOREANSETHESIA.getObject().getVisitItems()) {
            switch (p.getItemCode()) {
                case "xinXueGuan":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_02);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                    case "4":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[3];
                                        }
                                        else {
                                            content += arrays[3];
                                        }
                                        break;
                                    case "5":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[4];
                                        }
                                        else {
                                            content += arrays[4];
                                        }
                                        break;
                                    case "6":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[5];
                                        }
                                        else {
                                            content += arrays[5];
                                        }
                                        break;
                                    case "7":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[6];
                                        }
                                        else {
                                            content += arrays[6];
                                        }
                                        break;
                                    case "8":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[7];
                                        }
                                        else {
                                            content += arrays[7];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt01.setText(content);
                    }
                    break;
                case "FeiHeHuXi":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_03);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                    case "4":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[3];
                                        }
                                        else {
                                            content += arrays[3];
                                        }
                                        break;
                                    case "5":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[4];
                                        }
                                        else {
                                            content += arrays[4];
                                        }
                                        break;
                                    case "6":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[5];
                                        }
                                        else {
                                            content += arrays[5];
                                        }
                                        break;
                                    case "7":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[6];
                                        }
                                        else {
                                            content += arrays[6];
                                        }
                                        break;
                                    case "8":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[7];
                                        }
                                        else {
                                            content += arrays[7];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt02.setText(content);
                    }
                    break;
                case "MiNiaoXiTong":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_04);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                    case "4":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[3];
                                        }
                                        else {
                                            content += arrays[3];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt03.setText(content);
                    }
                    break;
                case "XiaoHua":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_05);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                    case "4":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[3];
                                        }
                                        else {
                                            content += arrays[3];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt04.setText(content);
                    }
                    break;
                case "ShenJingJiRou":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_06);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                    case "4":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[3];
                                        }
                                        else {
                                            content += arrays[3];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt05.setText(content);
                    }
                    break;
                case "XueYe":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
//                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_06);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt06.setText(content);
                    }
                    break;
                case "NeiFenMiDaiXie":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_07);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                    case "4":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[3];
                                        }
                                        else {
                                            content += arrays[3];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt07.setText(content);
                    }
                    break;
                case "JingShen":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_08);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt08.setText(content);
                    }
                    break;
                case "ChanKe":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
//                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_06);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt09.setText(content);
                    }
                    break;
                case "XiYanXuJiuYaoWuYiLai":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_09);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                    case "4":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[3];
                                        }
                                        else {
                                            content += arrays[3];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt10.setText(content);
                    }
                    break;
                case "GuoMinShiShouShuShi":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_10);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt11.setText(content);
                    }
                    break;
                case "JiWangMaZuiShi":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_11);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt12.setText(content);
                    }
                    break;
                case "JiaZuShiYiChuanBingShi":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_12);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt13.setText(content);
                    }
                    break;
                case "MuQianTeShuYaoWu":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
//                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_12);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt14.setText(content);
                    }
                    break;
                case "QuanShenQingKuang":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_13);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt15.setText(content);
                    }
                    break;
                case "YiShiZhuangTai":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_14);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt16.setText(content);
                    }
                    break;
                case "QiDaoTongChangDu":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_15);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                    case "4":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[3];
                                        }
                                        else {
                                            content += arrays[3];
                                        }
                                        break;
                                    case "5":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[4];
                                        }
                                        else {
                                            content += arrays[4];
                                        }
                                        break;
                                    case "6":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[5];
                                        }
                                        else {
                                            content += arrays[5];
                                        }
                                        break;
                                    case "7":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[6];
                                        }
                                        else {
                                            content += arrays[6];
                                        }
                                        break;
                                    case "8":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[7];
                                        }
                                        else {
                                            content += arrays[7];
                                        }
                                        break;
                                    case "9":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[8];
                                        }
                                        else {
                                            content += arrays[8];
                                        }
                                        break;
                                    case "10":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[9];
                                        }
                                        else {
                                            content += arrays[9];
                                        }
                                        break;
                                }
                            }
                        }
                        fragBaSt17.setText(content);
                    }
                    break;
                case "YaChi":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_16);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                    case "4":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[3];
                                        }
                                        else {
                                            content += arrays[3];
                                        }
                                        break;
                                    case "5":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[4];
                                        }
                                        else {
                                            content += arrays[4];
                                        }
                                        break;
                                    case "6":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[5];
                                        }
                                        else {
                                            content += arrays[5];
                                        }
                                        break;
                                    case "7":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[6];
                                        }
                                        else {
                                            content += arrays[6];
                                        }
                                        break;
                                }
                            }
                        }
                        fragBaSt18.setText(content);
                    }
                    break;
                case "YanKe":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_17);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt19.setText(content);
                    }
                    break;
                case "MaZuiChuanCiBuWei":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_18);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            for (int i = 1; i < array.length; i++) {
                                switch (array[i]) {
                                    case "1":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[0];
                                        }
                                        else {
                                            content += arrays[0];
                                        }
                                        break;
                                    case "2":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[1];
                                        }
                                        else {
                                            content += arrays[1];
                                        }
                                        break;
                                    case "3":
                                        if (content.length() > 0) {
                                            content += "\n";
                                            content += arrays[2];
                                        }
                                        else {
                                            content += arrays[2];
                                        }
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt20.setText(content);
                    }
                    break;
                case "XiongBuXPian":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
//                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_18);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt21.setText(content);
                    }
                    break;
                case "XinDianTu":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
//                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_18);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt22.setText(content);
                    }
                    break;
                case "ShiFouBaoWei":
                    if (p.getItemValue().length() > 0) {
                        String[] array = p.getItemValue().split(";");
                        String content = "";
//                        String[] arrays = getResources().getStringArray(R.array.beforeanesthesia_18);
                        if(array[0].equals("0"))
                        {
                            content+="否";
                        }
                        else if(array[0].equals("1")){
                            if(p.getItemOther().length()>0)
                            {
                                if (content.length() > 0) {
                                    content += "\n";
                                    content += p.getItemOther();
                                }
                                else {
                                    content += p.getItemOther();
                                }
                            }
                        }
                        fragBaSt23.setText(content);
                    }
                    break;
            }
        }
    }
}
